Skip to content

[SDK] Support multiple statuses in EscrowFilter#3481

Merged
portuu3 merged 4 commits intodevelopfrom
feat/sdk/escrow-statuses
Jul 28, 2025
Merged

[SDK] Support multiple statuses in EscrowFilter#3481
portuu3 merged 4 commits intodevelopfrom
feat/sdk/escrow-statuses

Conversation

@flopez7
Copy link
Copy Markdown
Contributor

@flopez7 flopez7 commented Jul 25, 2025

Issue tracking

None

Context behind the change

Support multiple statuses in EscrowFilter
Update unit tests

How has this been tested?

Launched several queries for testing

Release plan

Deploy new SDK version

Potential risks; What to monitor; Rollback plan

None

@flopez7 flopez7 requested review from Copilot, dnechay and portuu3 July 25, 2025 17:30
@flopez7 flopez7 self-assigned this Jul 25, 2025
@vercel
Copy link
Copy Markdown

vercel bot commented Jul 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 2:28pm
human-dashboard-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 2:28pm
staking-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 2:28pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Jul 28, 2025 2:28pm
faucet-server ⬜️ Ignored (Inspect) Visit Preview Jul 28, 2025 2:28pm

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for filtering escrows by multiple statuses in the SDK's EscrowFilter, allowing users to query escrows with an array of status values instead of being limited to a single status.

  • Updated EscrowFilter interface to accept both single status and array of statuses
  • Modified GraphQL queries to use status_in parameter for array filtering
  • Enhanced status processing logic in both TypeScript and Python SDKs

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts Updated IEscrowsFilter interface to accept status as either single value or array
packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts Modified GraphQL query to use status_in parameter for array filtering
packages/sdk/typescript/human-protocol-sdk/src/escrow.ts Added logic to transform status parameter into array format for GraphQL query
packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts Added unit test for multiple status filtering functionality
packages/sdk/typescript/human-protocol-sdk/example/escrow.ts Updated example to demonstrate multiple status filtering
packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py Updated EscrowFilter class to accept status as single value or list
packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py Modified GraphQL query generation to handle status arrays
packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py Added status array processing logic
packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py Added test cases and fixed manifest field names
Comments suppressed due to low confidence (2)

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py:30

  • [nitpick] The variable name use_statuses is unclear. Consider renaming it to status_array or formatted_statuses to better reflect its purpose of handling both single status and status array cases.
    use_statuses = (

packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py:38

  • The test data change from manifestUrl to manifest suggests a schema change, but there's no corresponding test to verify that the old field name is no longer accepted or that the new field name works correctly in isolation.
                "manifest": "https://example.com",

Comment thread packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py Outdated
Comment thread packages/sdk/typescript/human-protocol-sdk/src/escrow.ts Outdated
Comment thread packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py Outdated
Co-authored-by: Siarhei <sergey.dzeranov@gmail.com>
@portuu3 portuu3 merged commit ed55849 into develop Jul 28, 2025
14 checks passed
@portuu3 portuu3 mentioned this pull request Jul 28, 2025
2 tasks
@dnechay dnechay deleted the feat/sdk/escrow-statuses branch July 29, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants